﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;

namespace DreamBox.Admin.Posts
{
    public partial class ClassList : BLL.BasePage
    {
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!IsPostBack)
            {
                DAL.PSelect ps = new DAL.PSelect();
                RepeaterList.DataSource = ps.Select("dbox_PostsClass", "*", "");
                RepeaterList.DataBind();
            }
        }
        protected void LinkBtnDelete_Click(object sender, EventArgs e)
        {
            LinkButton linkBtn = sender as LinkButton;
            int CID = int.Parse(linkBtn.ToolTip);
            if (CID > 0)
            {
                Model.PostsClass m = new Model.PostsClass();
                m.CID = CID;

                DAL.MAction action = new DAL.MAction();
                if (action.Delete(m))
                {
                    BLL.Admin.Tips.DetailedTips(this, "操作成功", "/Posts/ClassList.aspx", "1");
                }
            }
        }
    }
}